<?php

/* @var $this \yii\web\View */
/* @var $content string */

use yii\helpers\Html;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\helpers\Url;
use yii\widgets\Breadcrumbs;
use frontend\assets\AppAsset;
use common\widgets\Alert;

AppAsset::register($this);
?>
<?php $this->beginPage() ?>

<html lang="<?= Yii::$app->language ?>">
	
<head>
	<script type="text/javascript" src="../../web/js/jquery-1.11.1.min.js" ></script>
	<link rel="stylesheet" href="../css/bootstrap.min.css">
    <meta  charset="<?= Yii::$app->charset ?>">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <?= Html::csrfMetaTags() ?>
    <title><?= Html::encode($this->title) ?></title>
    <?php $this->head() ?>
</head>
<body style="overflow-x:hidden;height: 100%;">

<!--<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>-->

<?= HTML::cssFile('@web/css/index.css') ?>
<?= HTML::jsFile('@web/js/jquery.js') ?>
<?= HTML::jsFile('@web/js/main.js') ?>



<!--
    	作者：732511064@qq.com
    	时间：2017-03-29
    	描述：导航条
    -->
<header>
    <div class="wrapper">
        <a href="<?= Url::to(['site/index']) ?>"><img src="<?=Url::to('@web/images/logo.jpg')?>" alt="Crafty" class="logo"></a>
        <a href="#" class="menu_icon" id="menu_icon"></a>

        <nav id="nav_menu">
            <ul>

                <?
                  foreach (\common\models\Type::find()->where(['isdisplay'=>1])->orderBy(['type_sort'=>SORT_ASC])->all() as $v){
                      echo '<li><a href="'.Url::to(["site/images","id"=>$v["id"]]).'">'.$v['type_name'].'</a></li>';
                  }
                ?>

                <?if(Yii::$app->user->isGuest){?>

                    <li class="navli2"><a href="<?= Url::to(['site/signup']) ?>">注册</a></li>
                    <li class="navli1"><a href="<?= Url::to(['site/login']) ?>">登陆</a></li>
                <?}else{?>
                    <li><a href="<?=Url::to(['images/create'])?>">我也要发图</a></li>
                    <li class="navli2"><a href="<?= Url::to(['site/logout']) ?>">退出</a></li>
                    <li class="navli1"><?= Yii::$app->user->identity->username ?></li>
                <?}?>
            </ul>
        </nav>

    </div>
</header>



<style>
    div{
        /*border: solid 1px;*/
    }
</style>
    <div>
        <?= Breadcrumbs::widget([
            'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
        ]) ?>
        <?= Alert::widget() ?>
        <?= $content ?>
    </div>



<footer>
    <a href="#"><img src="../images/xiong.gif" alt="Crafty" style='width: 300px;'></a>
</footer>

<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>


